From: Rui Matos Date: Thu, 14 Mar 2013 12:25:12 +0000 (+0100) Subject: status/keyboard: Check if this._currentSource is valid on activation X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4474 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=01deb9ef7ddf1b8f14170483404dec3e3382587f;p=gnome-shell.git status/keyboard: Check if this._currentSource is valid on activation this._currentSource might be invalid so check for that to prevent an exception and still switch to the newly activated source. https://bugzilla.gnome.org/show_bug.cgi?id=695841 --- diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index 4e629b107..3dc173b99 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -487,7 +487,7 @@ const InputSourceIndicator = new Lang.Class({ let is = new InputSource(type, id, displayName, shortName, i); is.connect('activate', Lang.bind(this, function() { - if (this._currentSource.index == is.index) + if (this._currentSource && this._currentSource.index == is.index) return; this._settings.set_value(KEY_CURRENT_INPUT_SOURCE, GLib.Variant.new_uint32(is.index));